package io.geekidea.boot.persmanag.service.impl;

import io.geekidea.boot.framework.page.Paging;
import io.geekidea.boot.framework.service.impl.BaseServiceImpl;
import io.geekidea.boot.otherstores.query.total;
import io.geekidea.boot.outboundBenhavior.query.OutboundBenhaviorQuery;
import io.geekidea.boot.persmanag.dto.PersManagDto;
import io.geekidea.boot.persmanag.dto.PersManagExcel;
import io.geekidea.boot.persmanag.entity.PersManag;
import io.geekidea.boot.persmanag.mapper.PersManagMapper;
import io.geekidea.boot.persmanag.query.PersManagQuery;
import io.geekidea.boot.persmanag.service.PersManagService;
import io.geekidea.boot.store.entity.Store;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
@Transactional(rollbackFor = Exception.class)
public class PersManagServiceImpl extends BaseServiceImpl<PersManagMapper, PersManag> implements PersManagService {

    @Resource
    private PersManagMapper persManagMapper;


    @Override
    public List<PersManag> getpersManagPageList(PersManagQuery persManagQuery) {
        return persManagMapper.getpersManagPageList(persManagQuery);
    }

    @Override
    public total getTotal(PersManagQuery persManagQuery) {
        return persManagMapper.getTotal(persManagQuery);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean delById(Integer id) {
        return persManagMapper.delById(id) > 0;
    }

    @Override
    public List<Store> getStoreList(Integer id) {
        return persManagMapper.getStoreList(id);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean addPersManag(PersManagDto persManagDto) {
        return persManagMapper.addPersManag(persManagDto) > 0;
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean updatePersManag(PersManag persManag) {
        return persManagMapper.updatePersManag(persManag)>0;
    }

//    @Override
//    @Transactional(rollbackFor = Exception.class)
//    public boolean addPersManag(PersManagDto persManagDto) {
//        PersManag persManag = new PersManag();
//        return persManag;
//    }

    @Override
    public PersManag getPersManag(Integer id) {
        return persManagMapper.getPersManag(id);
    }

    @Override
    public List<PersManagExcel> getDownloadList(PersManagQuery persManagQuery) {
        return persManagMapper.getDownloadList(persManagQuery);
    }
}

//    @Override
//    public boolean seleById(Integer id) {
//        return persManagMapper.seleById(id) = ;
//    }


